//导入mongoose模块
var mongoose = require("mongoose")
var Schema = mongoose.Schema   //构造函数 Schema

var users_schema = new Schema({
    username:String,
    password:String,
    age:Number,
    time:Date,
    Nickname:String,
    like:String,
    mobile:String
})

var mvs_schema = new Schema({
    "genres": Array,
    "casts":Array,
    "directors": Array,
    "rating":Object,
    "title": String,
    "collect_count": Number,
    "original_title": String,
    "subtype":String,
    "year": String,
    "images": Object,
    "alt": String,
    "id": String
})


//暴露Users 和 Mvs

exports.Users = mongoose.model("users",users_schema)
exports.Mvs = mongoose.model("movies",mvs_schema)


var comment_schema = new Schema({
    title: Array,
    content:String,
    author: Array,
     time: Date,
    mid: String,
    movie: Object,
    answer:Array
})
exports.Comment= mongoose.model("comments",comment_schema)


var prouser1_schema = new Schema({
    mobile:String,
    username:String,
    password:String,
    roleid:String,
    time:Date,
    avatar:String
 })
 
exports.Prouser = mongoose.model("prouser1",prouser1_schema);

// 个人体温记录 
var tiwen1_schema = new Schema({
    mobile:String,
    username:String,
    time:Date,
    tiwen:Number,
    ishei:String,  
    is_yin:String  // 1 阴性  0. 阳性  
 })

 exports.Tiwen = mongoose.model("tiwen1",tiwen1_schema);

// 意见记录 
var advise1_schema = new Schema({
    mobile:String,
    username:String,
    time:Date,
    title:String,
    content:String,
    category:String,
    reply:Array,
 })


 exports.Advise = mongoose.model("advise1",advise1_schema);

 // 购物社区 
var good_schema = new Schema({
     "name" : String, 
     "price" : Number, 
     "discount" : Number, 
     "img" : String, 
     "type" :Object,
 })
exports.Goods = mongoose.model("goods",good_schema);


var cart_schema = new Schema({
   "mobile":String,
   good:Object,
   goodId:String,
   count:Number,
   time:Date,
   checked:Boolean,
})

exports.Cart = mongoose.model("cart1",cart_schema);

//my-demo 入园打卡表
